<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>编辑机构</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/common/upLoadingFileSize.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js?t=${now}"></script>
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
    <style>
        #_btnDiv{
            height: 34px;
            margin-bottom: 0px;
        }
        .right-btn{
            float: right;
            margin-right: 5px;
            height: 25px;
            padding-top: 2px!important;
            margin-top: -7px;
        }
    </style>
    <script>
        var editType = '${editType}';
        var teamLeaderCode = '${teamLeaderCode}';
        var searchInfo = ${searchInfo};
        var oneBizAppInfo = ${oneBizAppInfo};
        var imgSrcDefault = "${ctx}/images/main/default.jpg";
        var teamRoleMap = ${teamRoleMap};
        var docListMap = ${docListMap};
        var roleMapList = ${roleMapList};
    </script>
</head>
<body class="gray-bg">
<div id="vue">
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <%--项目简介--%>
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-title">
                                    <h5>
                                        <c:if test="${editType == 'add'}">
                                            新增机构服务
                                        </c:if>
                                        <c:if test="${editType == 'edit'}">
                                            编辑机构服务
                                        </c:if>
                                        <c:if test="${editType == 'info'}">
                                            机构服务详情
                                        </c:if>
                                    </h5>
                                </div>
                                <div class="ibox-content">
                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</h5>
                                    <form class="form-horizontal m-t" id="_orgBizAppDataForm">
                                        <c:choose>
                                            <c:when test="${editType=='info'}">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">机构名称：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.orgName : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">团队名称：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.teamName : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">联系电话：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.contactPhone : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">排序：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.sortNum : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">团队介绍：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.teamIntroduction : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">团队缩略图：</label>
                                                    <div class="col-sm-8">
                                                        <div  class="col-sm-2">
                                                            <div class="gallerys">
                                                                <img style="float: left"
                                                                     class="img-rounded img-header gallery-pic"
                                                                     onclick='$.openPhotoGallery(this)'
                                                                     src="${not empty oneBizAppInfo.teamLogo && not empty oneBizAppInfo.teamLogo?oneBizAppInfo.teamLogo:ctx}${not empty oneBizAppInfo&&not empty oneBizAppInfo.teamLogo ?'':'/images/main/default.jpg'}">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">团队角色：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.role : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2"></label>
                                                    <div class="col-sm-8">
                                                        <c:if test="${not empty roleMapList}">
                                                            <c:forEach items="${roleMapList}" var="item">
                                                                <label class="col-sm-4">${not empty item ? item.roleName : ''}</label>
                                                                <label class="col-sm-4">${not empty item ? item.docName : ''}</label>
                                                                <label class="col-sm-4">排序：${not empty item ? item.sortNum : '999'}</label>
                                                            </c:forEach>
                                                        </c:if>
                                                    </div>
                                                    <label class="col-sm-2"></label>
                                                </div>
                                            </c:when>
                                            <c:otherwise>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">机构名称：</label>
                                                    <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.orgName : ''}</label>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>团队名称：</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" id="teamName" name="teamName" class="form-control" maxlength="20" required value="${not empty oneBizAppInfo ? oneBizAppInfo.teamName : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label">联系电话：</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" id="contactPhone" name="contactPhone" class="form-control" maxlength="20" value="${not empty oneBizAppInfo ? oneBizAppInfo.contactPhone : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label">排序：</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" id="sortNum" name="sortNum" class="form-control" maxlength="9" isPInteger="true" value="${not empty oneBizAppInfo ? oneBizAppInfo.sortNum : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label">团队介绍：</label>
                                                    <div class="col-sm-8">
                                                        <textarea type="text" id="teamIntroduction" name="teamIntroduction" class="form-control" maxlength="1000" style="height:80px;resize: none;">${not empty oneBizAppInfo ? oneBizAppInfo.teamIntroduction : ''}</textarea>
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label">团队缩略图：</label>
                                                    <div class="col-sm-8">
                                                        <div  class="col-sm-2">
                                                            <div class="gallerys">
                                                                <img style="float: left" id="logoImg"
                                                                     class="img-rounded img-header gallery-pic"
                                                                     onclick='$.openPhotoGallery(this)'
                                                                     src="${not empty oneBizAppInfo.teamLogo && not empty oneBizAppInfo.teamLogo?oneBizAppInfo.teamLogo:ctx}${not empty oneBizAppInfo&&not empty oneBizAppInfo.teamLogo ?'':'/images/main/default.jpg'}">
                                                            </div>
                                                        </div>
                                                        <div class="col-sm-10" style="text-align: left;">
                                                            <label class="ui-upload">浏览
                                                                <input type="file" id="imgChoose" name="imgChoose" style="left:-9999px;position:absolute;" onchange="onPreviewImg(this, 'logoImg')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
                                                            </label>
                                                            <label style="float: left;width: 100%;margin-left: 20px;">图片尺寸要求：64*64px，10k以内</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;团队角色
                                                </h5>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>团队成员：</label>
                                                    <div class="col-sm-8">
                                                        <button type="button" class="btn btn-primary right-btn" onclick="doDelTeamRole();">删除</button>
                                                        <button type="button" class="btn btn-primary right-btn" onclick="doAddTeamRole();">新增</button>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2"></label>
                                                    <div<%-- id="_teamRoleDiv"--%> class="col-sm-8">
                                                        <div class="form-group">
                                                            <label class="col-sm-4 control-content">团队长</label>
                                                            <div class="col-sm-4">
                                                                <select class="form-control" name="docName" id="docName0">
                                                                    <option value="">--请选择--</option>
                                                                    <c:forEach items="${leadDocListMap}" var="item">
                                                                        <option value="${item.code}" ${not empty oneBizAppInfo && oneBizAppInfo.roleLeaderCode == item.code? 'selected' : '' }>${item.name}</option>
                                                                    </c:forEach>
                                                                </select>
                                                            </div>
                                                            <label class="col-sm-1 control-label">排序：</label>
                                                            <label class="col-sm-3 control-content">1</label>
                                                        </div>
                                                        <div id="_teamRoleDiv">
                                                        </div>
                                                    </div>
                                                    <label class="col-sm-2"></label>
                                                </div>
                                            </c:otherwise>
                                        </c:choose>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${editType!='info'}">
                            <input type="button" class="btn btn-primary" onclick="doCheckImage()" value="保存">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/org/win/editOrgTeamMgr.js?t=${now}"></script>
</body>
</html>


